package casa.depesos.app.com.http.req;


import casa.depesos.app.com.http.HttpReq;
import casa.depesos.app.com.http.Req;
import casa.depesos.app.com.http.ReqCallback;
import casa.depesos.app.com.http.bean.GetCodeBean;
import casa.depesos.app.com.http.parser.GetCodeParser;
import casa.depesos.app.com.utils.Constant;
import okhttp3.FormBody;

public class ReApplyReq implements HttpReq<GetCodeBean> {

    @Override
    public void req(ReqCallback<GetCodeBean> callback) {//  restartApply
        FormBody.Builder builder = new FormBody.Builder();
        builder.add("reqnum", Constant.getApplyId())
                .add("mobiTok", Constant.getToken());
        Req.post("/app/riskTask/reapplyForTask", getParam(), getHeader(), builder.build(), new GetCodeParser(), new ReqCallback<GetCodeBean>() {
            @Override
            public void callback(boolean success, GetCodeBean bean) {
                if (success) {
                    Constant.reset = true;
                }
                callback.callback(success, bean);
            }
        }, this);
    }
}
